/**
 * User: Obi
 * Date: 31.07.11
 * Time: 16:31
 */
package com.jediflasher.game_client.events.server {
import com.jediflasher.game_client.server.MessageWrapper;

import flash.events.Event;

public class ServerConnectorEvent extends Event {

	public static const MESSAGE_RECEIVED:String = "messageReceived";
	public static const CONNECT:String = "connect";
	public static const ERROR:String = "error";
	public static const DISCONNECT:String = "disconnect";

	public function ServerConnectorEvent(type:String, messageWrapper:MessageWrapper = null, bubbles:Boolean = false, cancelable:Boolean = false) {
		super(type, bubbles, cancelable);
		this._messageWrapper = messageWrapper;
	}

	/**
	 * @private
	 */
	private var _messageWrapper:MessageWrapper;

	/**
	 * Сообщение от сервера
	 */
	public function get messageWrapper():MessageWrapper {
		return this._messageWrapper;
	}

	/**
	 * @inheritDoc
	 */
	override public function clone():Event {
		return new ServerConnectorEvent(type, messageWrapper, bubbles, cancelable);
	}
}
}
